{extend name='public/base'}
{block name='content'}

<!-- <style type="text/css">
   
</style> -->

    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        {$item['item1']}
        <small>{$item['item2']}</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> {$item['item1']}</a></li>
        <li class="active">{$item['item2']}</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">搜索栏</h3>
            </div>
    
            <form class="form-horizontal layui-form" action="{:url('admin/settled/index')}" method="get">
                <div class="box-body" style="padding: 15px;">
                    <div>
                        <div class="col-sm-2">
                            <input type="text" name="clinic" value="{$clinic|default=''}" class="form-control" placeholder="请输入诊所名称">
                        </div>
                        <div class="col-sm-2">
                            <input type="text" name="tel" value="{$tel|default=''}" class="form-control" placeholder="请输入电话">
                        </div>
    
                        <div class="col-sm-1">
                            <button type="submit" class="layui-btn layui-btn-sm layui-btn-warm">搜索</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    
        <blockquote class="layui-elem-quote layui-text clw">
            <button onclick="javascript:location.reload()" class="btn btn-info btn-sm">刷新</button>
        </blockquote>      

      <div class="row" >
        <div class="col-xs-12">
          <!-- /.box -->
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">列表</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1" class="table table-bordered table-hover table-striped">
                <thead>
                <tr>
                  <th>编号</th>
                  <th>诊所名称</th>
                  <th>申请用户id</th>                  
                  <th>姓名</th>
                  <th>联系电话</th>
                  <th>性别</th>
                  <th>身份证</th>                                    
                  <th>省</th>
                  <th>市</th>
                  <th>区</th>                  
                  <th>详细地址</th>
                  <th>审核</th>
                  <th>操作</th>
                </tr>
                </thead>
                <tbody>
                  {volist name='list' id='vo'}
                  <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.clinic}</td>
                    <td>{$vo.user_id}</td>                    
                    <td>{$vo.name}</td>
                    <td>{$vo.tel}</td> 
                    <td>{$vo.sex}</td>
                    <td>{$vo.card_id}</td>                    
                    <td>{$vo.province}</td>
                    <td>{$vo.city}</td>
                    <td>{$vo.area}</td>
                    <td>{$vo.address}</td>
                    <td>
                      {eq name="vo.type" value="0"}
                        <text style="color: brown">待审核</text>
                      {/eq}
                      {eq name="vo.type" value="1"}
                      <text style="color:green">审核通过</text>
                      {/eq}
                      {eq name="vo.type" value="2"}
                      <text style="color:gold">审核未通过</text>
                      {/eq}
                    </td>                  
                    <td>
                       {eq name="vo.type" value="0"}
                          <button onclick="lotus_show('诊所资料','view_clinic.html?id={$vo.id}',1200,800)" class="btn btn-xs  btn-success btn-small">立即审核</button>
                       {/eq}
                       {eq name="vo.type" value="1"}
                          <button onclick="lotus_show('诊所资料','view_clinic.html?id={$vo.id}',1200,800)" class="btn btn-xs  btn-success btn-small">查看</button>
                       {/eq}
                       {eq name="vo.type" value="2"}
                          <button onclick="lotus_show('诊所资料','view_clinic.html?id={$vo.id}',1200,800)" class="btn btn-xs  btn-success btn-small">查看</button>
                          <button onclick='delete_clinic({$vo.id})' class="btn btn-xs  btn-danger btn-small">删除</button>
                       {/eq}
                    </td>
                  </tr>
                  {/volist}

                </tbody>
               
               <!--  <tfoot>
                <tr>
                  <th>Rendering engine</th>
                  <th>Browser</th>
                  <th>Platform(s)</th>
                  <th>Engine version</th>
                  <th>CSS grade</th>
                </tr>
                </tfoot> -->
              </table>
              <div class="page page_right">
                  <div>
                    {$list->render()}
                  </div>
              </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->

{/block}


{block name='script'}
<script>

    //新增用户的模态框数据清除
    $("#addModal,#editModal").on('hide.bs.modal',function(){
        $('#addReset').click();
    });
    //加载缓冲动画
    $("#addModal,#editModal").on('show.bs.modal',function(){
         layer.closeAll();
    });


    //删除用户
    function delete_clinic(id){
       layer.confirm('真的删除行么', function(index){
            $.ajax({
              url: '{:url("admin/Settled/delete_clinic")}',
              type: 'get',
              dataType: 'json',
              data: {id:id},
          })
          .done(function(data){
              //回调提示
              if(data.code==0){
                      layer.msg(data.msg,{icon:2,time:1000});
                  }else{
                      layer.msg(data.msg,{icon:1,time:1500},function(){
                           location.reload();
                      });
              }
          })


       })

    }



</script>
{/block}